module.exports = {
	name: 'add',
	data() {
		return {
			// brand: '',
			// name: '',
			// standard: '',
			// blBuPr: '',
			// prForWaUs: '',
			// prForWaSt: '',
			// prForWaDe: '',
			// producerPrice: '',
			// isDisposable: '',
			// picUrl: '',
			// picDialogVisible: false,

			form:{
				waterFactoryName: "怡宝水厂",
				brand: '',
				name: '',
				standard: '',
				blBuPr: '',
				prForWaUs: '',
				prForWaSt: '',
				prForWaDe: '',
				producerPrice: '',
				isDisposable: '',
				picUrl: '',
				picDialogVisible: false
			},
			rules: {
				waterFactoryName: [{
					required:true,message:'水厂不能为空'
				}],
				brand: [{
					required: true,message:'品牌不能为空'
				}],
				name: [{
					required: true,message: '名称不能为空'
				}],
				standard: [{
					required: true,message: '规格不能为空'
				}],
				blBuPr: [{
					required: true,message: '空桶价格不能为空'
				}],
				prForWaUs: [{
					required: true,message: '售价不能为空'
				}],
				prForWaSt: [{
					required: true,message: '水店价不能为空'
				}],
				prForWaDe: [{
					required: true,message: '配送提成不能为空'
				}],
				producerPrice: [{
					required: true,message: '出厂价不能为空'
				}],
				isDisposable: [{
					required: true,message: '一次性用水不能为空'
				}],

			},
		}
		
	},
	methods: {
		getAllFactories() {
			// this.waterFactoryName = "怡宝水厂";
		},

		handleRemove(file, fileList) {
		  console.log(file, fileList);
		},
		handlePictureCardPreview(file) {
		  this.picUrl = file.url;
		  this.picDialogVisible = true;
		},
		submitForm(formname) {
			//ajax提交数据
			console.log(this.form.brand+this.form.name);
		}
	},
}